import {CoordTRFUtil} from "../../common/tools/coordtool";
class AbsDisPtSvc {
    constructor() {
        this.desc = "";
        this.auxMarkSize = 10;
    }
    subDisplay(aborbPtInfo, map, mapInfo){

    }
    display(aborbPtInfo, map, mapInfo) {
        this.subDisplay(aborbPtInfo, map, mapInfo);
        if (this.desc != "") {
            this.displayText(aborbPtInfo, map, mapInfo);
        }
    }

    displayText(aborbPtInfo, map, mapInfo) {
        let sp = CoordTRFUtil.world2Screen(aborbPtInfo.pt, mapInfo);
        let tx = sp.x + this.auxMarkSize/2;
        let ty = sp.y + this.auxMarkSize/2;
        let txtPt = { x: tx, y: ty };
        map.fillStyle = aborbPtInfo.color.toHexString();
        var canvasfont = "18px 仿宋";
        map.font = canvasfont;
        map.fillText(this.desc, txtPt.x, txtPt.y);
    }
}

export { AbsDisPtSvc }